<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>数据字典值修改</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/common/component/jquery-easyui-1.3.1/themes/gray/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/common/component/jquery-easyui-1.3.1/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/common/component/jquery/jquery-1.7.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/common/component/jquery-easyui-1.3.1/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/common/component/jquery-easyui-1.3.1/src/jquery.parser.js"></script>
<style type="text/css">
	
	body {
		margin: 0;
		font-size: 12px;
	}
	
	.field {
		margin-top:20px;
	}
	
	.field input,textarea {
		width:60%;
	}
	
	.field textarea {
		height: 100px;
		resize: none;
	}
	
	.fieldName {
		display: inline-block;
		width: 30%;
		text-align: left;
		margin-left:20px;
	}
	
</style>
</head>
<body>

	<div style="background:#fafafa;padding:2px;border:1px solid #ddd">
	    <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-save'" onclick="save()">确定</a>
	</div>
	<div class="field">
		<div class="fieldName">数据字典值：<span style="color:red;">*</span></div>
		<input type="hidden" id="value" name="value" value="${param.value }"/>
		<input type="text" id="text" name="text"/>
	</div>

</body>
<script type="text/javascript">

	var dictId = "${param.dictId}";
	
	$(document).ready(function(){
		fillData();
	});

	function save() {
		if(!$("#text").val()) {
			return;
		}
		$.post("dict.action.jsp", {action:"editDictItem",dictId:dictId,value:$("#value").val(),text:$("#text").val()}, function(data){
			if($.trim(data) == "success") {
				window.parent.loadDictItem(dictId);
				window.parent.ymPrompt.close();
			} else {
				alert("添加错误");
			}
		});
	}
	
	function fillData() {
		$("#text").val(unescape("${param.text}"));
	}
	
</script>
</html>